load("@io_bazel_rules_go//go:def.bzl", "go_binary", "go_library", "go_test")

exports_files(["gencopy.bash.in"])

go_library(
    name = "gencopy_lib",
    srcs = ["gencopy.go"],
    importpath = "github.com/stackb/rules_proto/cmd/gencopy",
    visibility = ["//visibility:private"],
    deps = ["@com_github_google_go_cmp//cmp"],
)

go_binary(
    name = "gencopy",
    embed = [":gencopy_lib"],
    visibility = ["//visibility:public"],
)

go_test(
    name = "gencopy_test",
    srcs = ["gencopy_test.go"],
    embed = [":gencopy_lib"],
    deps = [
        "@bazel_gazelle//testtools:go_default_library",
        "@com_github_google_go_cmp//cmp",
    ],
)

filegroup(
    name = "all_files",
    testonly = True,
    srcs = [
        "BUILD.bazel",
        "gencopy.bash.in",
        "gencopy.bzl",
        "gencopy.go",
        "gencopy_test.go",
    ],
    visibility = ["//:__pkg__"],
)
